package com.googlecode.cswish.struts;

import org.apache.struts2.ServletActionContext;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletContext;

import com.opensymphony.xwork2.ActionContext;

/**
 * @author Jerry.Feng Date: 2008-6-13
 */
public class MockActionContext {
	
	public static ActionContext getContext() {
		ActionContext context = ActionContext.getContext();
		
		ServletActionContext.setRequest(new MockHttpServletRequest());
		ServletActionContext.setResponse(new MockHttpServletResponse());
		ServletActionContext.setServletContext(new MockServletContext());
		
		// TODO: more instance
		
		return context;
	}
}
